package com.ostrich.demomvvm.ui.home.repository

import androidx.lifecycle.LiveData
import com.ostrich.demomvvm.mvvm.BaseRepository
import com.ostrich.demomvvm.net.BaseResponse
import com.ostrich.demomvvm.ui.banner.BannerApi
import com.ostrich.demomvvm.ui.home.HomeApi
import com.ostrich.demomvvm.ui.home.entity.VideoEntity
import retrofit2.http.GET
import retrofit2.http.Query

/**
 * @Author : yaotianxue
 * @Time : On 2023/10/19 09:17
 * @Description : HomeRepository
 */
class HomeRepository:BaseRepository() {
    private val homeApi: HomeApi by lazy { createService(HomeApi::class.java) }

    fun findVideos(currentPage:Int, pageSize:Int): LiveData<BaseResponse<MutableList<VideoEntity>>>{
        return homeApi.findVideos(currentPage,pageSize)
    }

    fun findVideoByName( keywords:String): LiveData<BaseResponse<MutableList<VideoEntity>>>{
        return homeApi.findVideoByName(keywords)
    }

}